Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using deprecated OpenSSL::Digest::Digest #103

Merged
merged 2 commits into from
Jan 28, 2014

Conversation

chrishunt
Copy link

OpenSSL::Digest::Digest is deprecated as of Ruby 2.1 and has been discouraged since Ruby 1.8.7.

See: http://goo.gl/E4O0Oq

Fixes a deprecation warning in Ruby 2.1:

Digest::Digest is deprecated; use Digest

OpenSSL::Digest::Digest is deprecated as of Ruby 2.1 and has been
discouraged since Ruby 1.8.7.

See: http://goo.gl/E4O0Oq
@@ -56,7 +56,7 @@ def asset_proxy_url(url)

# Private: calculate the HMAC digest for a image source URL.
def asset_url_hash(url)
digest = OpenSSL::Digest::Digest.new('sha1')
digest = OpenSSL::Digest.new('sha1')
OpenSSL::HMAC.hexdigest(digest, asset_proxy_secret_key, url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass in "sha1" directly and avoid the extra digest object.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very nice. Thank you 👍

@jch
Copy link
Contributor

jch commented Jan 28, 2014

🍻

jch added a commit that referenced this pull request Jan 28, 2014
Stop using deprecated OpenSSL::Digest::Digest
@jch jch merged commit 5744986 into gjtorikian:master Jan 28, 2014
@chrishunt chrishunt deleted the drop-a-digest branch January 28, 2014 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants